home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / trans.com / TRANS.BAT < prev    next >
Encoding:
DOS Batch File  |  1990-02-02  |  1.6 KB  |  61 lines

  1. @ECHO OFF
  2. REM
  3. REM If you have an old version of DOS you may need to remove the
  4. REM "@" from the first line to make it work.
  5. REM
  6. REM To make ECHO print an empty line I specify a parameter of
  7. REM chr$(255).  To do this follow the ECHO command with a space
  8. REM and then while holding down the ctrl and alt keys type 255 on
  9. REM the number pad.  Numbers on the keyboard will not work!
  10. ECHO  
  11. ECHO TRANSLATE - Copyright 1990 by Gil Yoder
  12. ECHO P.O. Box 307 - Coalgate, OK 74538
  13. ECHO CIS# 73237,3103
  14. ECHO  
  15. REM
  16. REM Handle command lines with possibly more than 9 parameters.
  17. SET TR=%1 %2 %3 %4 %5 %6 %7 %8 %9
  18. :LOOP
  19. SHIFT
  20. IF "%9" == "" GOTO ENDLOOP
  21. SET TR=%TR% %9
  22. GOTO LOOP
  23. :ENDLOOP
  24. REM
  25. TRANSLAT %TR%
  26. REM
  27. REM Handle errors
  28. IF ERRORLEVEL 4 GOTO BADPARAM
  29. IF ERRORLEVEL 3 GOTO TOOMANY
  30. IF ERRORLEVEL 2 GOTO NOPARAM
  31. IF ERRORLEVEL 1 GOTO ODDPARAM
  32. REM
  33. REM If TRANSLATE loaded correctly
  34. ECHO Thank you for using TRANSLATE!
  35. GOTO END
  36. :BADPARAM
  37. ECHO BAD PARAMETER: Correct and retry.
  38. ECHO  
  39. :NOPARAM
  40. ECHO SYNTAX:  TRANS oooo nnnn [oooo nnnn...]
  41. ECHO  
  42. ECHO LEGEND:  oooo    4 digit hex value for key to translate
  43. ECHO          nnnn    4 digit hex value, new value for old key
  44. ECHO  
  45. ECHO Proper values for digits are 0123456789ABCDEF.  Use zeros
  46. ECHO to left pad values less than 1000 hex.  Lower case
  47. ECHO characters are not allowed.
  48. ECHO  
  49. ECHO Up to five pairs may be specified.
  50. GOTO END
  51. :TOOMANY
  52. ECHO TOO MANY PARAMETERS: Correct and retry.
  53. ECHO  
  54. GOTO NOPARAM
  55. :ODDPARAM
  56. ECHO PARAMETERS NOT PAIRED: Correct and retry.
  57. ECHO  
  58. GOTO NOPARAM
  59. :END
  60. SET TR=
  61.